from Agent01.agent import SimpleAgent


def main():
    print("🤖 简单工具Agent启动！")
    print("功能：天气查询 + 百科知识")
    print("输入'退出'结束对话\n")

    agent = SimpleAgent()

    while True:
        try:
            user_input = input("💬 请输入: ").strip()

            if user_input.lower() in ['退出', 'quit', 'exit']:
                print("👋 再见！")
                break

            if not user_input:
                continue

            response = agent.process(user_input)
            print(f"🤖 {response}\n")

        except KeyboardInterrupt:
            print("\n👋 再见！")
            break
        except Exception as e:
            print(f"❌ 错误: {e}")


if __name__ == "__main__":
    main()